package com.xuelang.pipeline.artifact.app.resource.converter;

import com.xuelang.pipeline.artifact.client.resource.dto.RepositoryComponentDTO;
import com.xuelang.pipeline.artifact.domain.resource.RepositoryComponent;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * 制品组件DTO与制品组件实体转换器
 *
 * @author xiwen.zxg
 * @since 2024/5/15
 */
@Mapper
public interface RepositoryComponentDTOToRepositoryComponentConverter {
    RepositoryComponentDTOToRepositoryComponentConverter INSTANCE = Mappers.getMapper(RepositoryComponentDTOToRepositoryComponentConverter.class);

    /**
     * RepositoryComponent转化为RepositoryComponentDTO
     * @param repositoryComponent
     * @return
     */
    RepositoryComponentDTO repositoryComponentToRepositoryComponentDTO(RepositoryComponent repositoryComponent);

    /**
     * RepositoryComponentDTO转化为RepositoryComponent
     * @param repositoryComponentDTO
     * @return
     */
    RepositoryComponent repositoryComponentDTOToRepositoryComponent(RepositoryComponentDTO repositoryComponentDTO);
}
